package main

import (
	"gitee.com/zhenyangze/gin-framework/internal/pkg/bootstrap"
)

func main() {
	defer Done()

	Run()
}

func Run() {
	// Initialize new architecture
	bootstrapper, err := bootstrap.NewBootstrapper("configs")
	if err != nil {
		panic("Failed to create bootstrapper: " + err.Error())
	}

	if err := bootstrapper.Bootstrap(); err != nil {
		panic("Failed to bootstrap application: " + err.Error())
	}

	// Start the application server
	if err := bootstrapper.Start(); err != nil {
		panic("Failed to start application: " + err.Error())
	}
}

func Done() {
	// Cleanup handled by bootstrap shutdown
}